<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>

</body>
</html>
<script>
    //方法一
    function Cacl(a,b) {
            var res =  Cacl.add =  a + b;
            var res = Cacl.minus =  a - b;
            var res = Cacl.multi =  a * b;
            var res = Cacl.divi =  a / b;
            return res;
    }
   //方法2
    var Cacl2 = {
        add:function (a,b){
            return a + b;
        },
        minus:function (a,b) {
            return a - b;
        },
        multi:function (a,b) {
        return a*b;
        },
        divi:function (a,b) {
            return a / b;
        },
    };
    var a = 100;
    var b = 200;
    console.log(Cacl2.add(a,b));
    console.log(Cacl2.minus(a,b));
    console.log(Cacl2.multi(a,b));
    console.log(Cacl2.divi(a,b));

    // new Cacl(a,b);
    // console.log(Cacl.add);
    // console.log(Cacl.minus);
    // console.log(Cacl.multi);
    // console.log(Cacl.divi);



</script>